<?php include( "templates/include/header.php" );
  include( "templates/include/adminHeader.php" );?>
 
      <div id="adminHeader">
        <h2>Administation des Liens</h2>
        <p>Vous &ecirc;tes connect&eacute; en tant que <b><?php echo htmlspecialchars( $_SESSION['username']) ?></b>. <a href="admin.php?action=logout"?>Se D&eacute;connecter</a></p>
      </div>
 
      <h1>Les liens</h1>
 
<?php if ( isset( $results['errorMessage'] ) ) { ?>
        <div class="errorMessage"><?php echo $results['errorMessage'] ?></div>
<?php } ?>
 
 
<?php if ( isset( $results['statusMessage'] ) ) { ?>
        <div class="statusMessage"><?php echo $results['statusMessage'] ?></div>
<?php } ?>
	<table class="CycleFade1">
    <?php
      foreach( $results['link'] as $link ) { ?>
        <tr onclick="location='admin.php?action=editLink&amp;linkId=<?php echo $link->id?>'">
          <td>
          <?php              
            if ( isset( $link->title ) ) { 
              echo( $link->title );
            }
          ?>
        </td>
        <td>
        <?php
          if ( isset( $link->url ) ) {
            echo( $link->url );
          }
        ?>  
        </td>
      </tr>
    <?php } ?>
  </table> 

  <p><?php echo $results['totalRows']?> article<?php echo ( $results['totalRows'] != 1 ) ? 's' : '' ?> au total.</p> 
  <p><a href="admin.php?action=newLink">Ajouter un Article</a></p>

<?php 
  include( "templates/include/adminFooter.php" );
  include( "templates/include/footer.php" ); ?>
